/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gob.fonafe.dao.impl.stored;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;
import javax.sql.DataSource;
import oracle.jdbc.OracleTypes;
import org.springframework.jdbc.core.RowMapper;
import org.springframework.jdbc.core.SqlOutParameter;
import org.springframework.jdbc.object.StoredProcedure;
import pe.gob.fonafe.domain.ClaseSubastaBean;

/**
 *
 * @author czela
 */
public class ListarClaseSubastaSP extends StoredProcedure{

    private static final String PROC_PARAM="USERGLC.P_LISTAR_CLASE_SUBASTA";


    public ListarClaseSubastaSP(DataSource ds) {
        super(ds, PROC_PARAM);

        declareParameter(new SqlOutParameter("cCURSOR", OracleTypes.CURSOR,new ListarClaseSubastaRowMapper()));
        compile();
    }

    public Map execute(){
        Map inputs = new HashMap();
        return super.execute(inputs);
    }

    private static class ListarClaseSubastaRowMapper implements RowMapper<ClaseSubastaBean>{

        public ClaseSubastaBean mapRow(ResultSet rs, int rowNum) throws SQLException {
            ClaseSubastaBean bean = new ClaseSubastaBean();
            bean.setId(rs.getString("ID_CLASE_SUBASTA"));
            bean.setClaseSubasta(rs.getString("CLASES"));
            return bean;
        }

    }


}
